<template>
	<view>
		<van-image @click="preview(url)" fit="cover" width="100" height="100" :src="url" />
	</view>
</template>

<script>
	import vanImage from '@/wxcomponents/vant/dist/image'
	export default {
		components: {
			vanImage
		},
		props: ['url'],
		data() {
			return {

			};
		},
		methods: {
			preview(url) {
				let imageList = [url]
				uni.previewImage({
					urls: imageList,
					longPressActions: {
						itemList: ['发送给朋友', '保存图片', '收藏'],
						success: function(data) {
							console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
						},
						fail: function(err) {
							console.log(err.errMsg);
						}
					}
				})
			}
		}
	}
</script>

<style>

</style>
